<template>
  <div id="time-limit" :style="'background:'+datas.params.bgcolor">
    <div id="rush-buy">
      <!-- 商品组标题 -->
      <h4 :style="'height:1.875rem;line-height:1.875rem;font-size:1rem;text-align:left;'+'background:'+datas.params.bgcolor+';'+'color:'+datas.params.titlecolor"
          v-if="datas.params.showtitle == 1?true:false">{{datas.params.title|escapeTitle}}</h4>
      <!-- 单行 -->
      <div class="single-row" v-if="datas.params.style=='100%' && showTime(item.start_time)?true:false"
           v-for="(item,k) in datas.data" @click.stop.prevent="buy(item)" :key="k">
        <div class="img" :style="{ backgroundImage:'url('
                     +
                     (item.img?item.img:require('../assets/images/loading.jpg'))
                     +')'} ">
          <!-- <img :src="item.img?item.img:require('../assets/images/loading.jpg')"> -->
          <div class="sale-img" :class="datas.params.option"></div>
          <div class="time-box" v-if="datas.params.countdown">
            <template v-if="new Date()>new Date(item.start_time)">
              <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.end_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
            </template>
            <template v-else>
              <span>距开始：</span>
              <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.start_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
            </template>
          </div>
        </div>
        <ul class="text">
          <li class="title">
            <h2 v-if="showTitle">{{item.name|escapeTitle}}</h2>
            <span v-if="datas.params.overage">仅剩<big>{{item.stock}}</big>件</span>
          </li>
          <li class="price">
                        <span class="left" v-if="datas.params.price != '0' && datas.params.price == 1?true:false">
                                            <font class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</font>
                                            <font class="price-b" :style="'color:'+datas.params.titlecolor"
                                                  v-if="!(item.pricenow ==  item.priceold)"><small>{{$i18n.t('money')}}</small>{{ item.priceold }}</font>
                                        </span>
            <span class="left" v-if="datas.params.price != '0' && datas.params.price == 2?true:false">
                                            <font class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</font>
              <!-- <font class="price-b"><small>{{$i18n.t('money')}}</small>128.50</font> -->
                                        </span>
            <button type="button" v-if="!(fun.isTextEmpty(datas.params.buysub))" :class="datas.params.buysub"
                    @click="buy(item)">立即抢购
            </button>
          </li>
        </ul>
      </div>
      <!-- 双行 -->
      <div class="double-row" v-if="datas.params.style=='49.5%'?true:false">
        <dl class="list-box" v-for="(item,index) in datas.data" :key="index" v-if="showTime(item.start_time)"
            @click.stop.prevent="buy(item)">
          <dt class="img" :style="{ backgroundImage:'url('
                     +
                     (item.img?item.img:require('../assets/images/loading.jpg'))
                     +')'} ">
            <!-- <img :src="item.img?item.img:require('../assets/images/loading.jpg')"> -->
            <div class="sale-img" :class="datas.params.option"></div>
            <div class="time-box" v-if="datas.params.countdown">
              <template v-if="new Date()>new Date(item.start_time)">
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.end_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
              <template v-else>
                <div style="font-size: 14px; color: #fff;">距开始:</div>
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.start_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
            </div>
          </dt>
          <dt class="text">
            <h2 v-if="showTitle">{{item.name|escapeTitle}}</h2>
          <dd class="price" v-if="datas.params.price != '0' && datas.params.price == 1?true:false">
            <span class="left" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
            <span class="right" :style="'color:'+datas.params.titlecolor" v-if="!(item.pricenow ==  item.priceold)"><small>{{$i18n.t('money')}}</small>{{item.priceold}}</span>
          </dd>
          <dd class="price" v-if="datas.params.price != '0' && datas.params.price == 2?true:false">
            <span class="left" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
            <!-- <span class="right"><small>{{$i18n.t('money')}}</small>228.50</span> -->
          </dd>
          <dd class="rob">
            <span class="left" v-if="datas.params.overage">仅剩<big>{{item.stock}}</big>件</span>
            <button type="button" v-if="!(fun.isTextEmpty(datas.params.buysub))" :class="datas.params.buysub"
                    @click="buy(item)">立即抢购
            </button>
          </dd>
          </dt>
        </dl>
      </div>
      <!-- 三行 -->
      <div class="three-row" v-if="datas.params.style=='33.3%'?true:false">
        <dl class="list-box" v-for="(item,i) in datas.data" v-if="showTime(item.start_time)"
            @click.stop.prevent="buy(item)" :key='i'>
          <dt class="img" :style="{ backgroundImage:'url('
                     +
                     (item.img?item.img:require('../assets/images/loading.jpg'))
                     +')'} ">
            <!-- <img :src="item.img?item.img:require('../assets/images/loading.jpg')"> -->
            <div class="sale-img" :class="datas.params.option"></div>
            <div class="time-box" v-if="datas.params.countdown">
              <template v-if="new Date()>new Date(item.start_time)">
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.end_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
              <template v-else>
                <div style="font-size: 14px; color: #fff;">距开始:</div>
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.start_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
            </div>
          </dt>
          <dt class="text">
            <h2 v-if="showTitle">{{item.name|escapeTitle}}</h2>
          <dd class="price" v-if="datas.params.price != '0' && datas.params.price == 1?true:false">
            <span class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
            <!-- <span class="price-b" :style="'color:'+datas.params.titlecolor" v-if="!(item.pricenow ==  item.priceold)"><small>{{$i18n.t('money')}}</small>{{item.priceold}}</span> -->
          </dd>
          <dd class="price" v-if="datas.params.price != '0' && datas.params.price == 2?true:false">
            <span class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
          </dd>
          <dd class="rob">
            <span class="left" v-if="datas.params.overage">仅剩<big>{{item.stock}}</big>件</span>
          </dd>
          <dd class="button" v-if="!(fun.isTextEmpty(datas.params.buysub))">
            <button type="button" :class="datas.params.buysub" @click="buy(item)">立即抢购</button>
          </dd>
          </dt>
        </dl>
      </div>
      <!-- 横 -->
      <div class="across-row" v-if="datas.params.style=='hp'?true:false">
        <div class="list" v-for="(item,j) in datas.data" :key='j' v-if="showTime(item.start_time)" @click.stop.prevent="buy(item)">
          <div class="img">
            <img :src="item.img?item.img:require('../assets/images/loading.jpg')">
            <div class="sale-img" :class="datas.params.option"></div>

            <div class="time-box" v-if="datas.params.countdown">
              <template v-if="new Date()>new Date(item.start_time)">
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.end_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
              <template v-else>
                <div style="font-size: 14px; color: #fff;">距开始:</div>
                <van-count-down :time="fun.getTimeDifference(fun.getTimestamp(item.start_time))" format="DD天HH时mm分ss秒" style="color: #fff;"/>
              </template>
            </div>
          </div>
          <ul class="text">
            <h2 v-if="showTitle">{{item.name|escapeTitle}}</h2>
            <li class="price" v-if="datas.params.price != '0' && datas.params.price == 1?true:false">
              <span class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
              <span class="price-b" :style="'color:'+datas.params.titlecolor" v-if="!(item.pricenow ==  item.priceold)"><small>{{$i18n.t('money')}}</small>{{item.priceold}}</span>
            </li>
            <li class="price" v-if="datas.params.price != '0' && datas.params.price == 2?true:false">
              <span class="price-a" :style="'color:'+datas.params.titlecolor"><small>{{$i18n.t('money')}}</small>{{item.vip_level_status&&item.vip_level_status.status==1?item.vip_level_status.word:item.pricenow}}</span>
            </li>
            <li class="rob">
              <span class="left" v-if="datas.params.overage">仅剩<big>{{item.stock}}</big>件</span>
            </li>
            <li class="button" v-if="!(fun.isTextEmpty(datas.params.buysub))">
              <button type="button" :class="datas.params.buysub" @click="buy(item)">立即购买</button>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div v-if="showMore">
      <div class="loadMore"
           v-if="$store.state.temp.item.data[index].isLoadMore || isLoadMore"
           @click="getMoreData">
        {{ $i18n.t("加载更多") }}
      </div>
      <div class="loadMore"
           v-if="
            !$store.state.temp.item.data[index].isLoadMore &&
              !isLoadMore &&
              datas.Identification === 1
          ">
        {{ $i18n.t("没有更多了") }}~~
      </div>
    </div>
  </div>
</template>

<script>
const documentElement = document.documentElement;
const body = document.body;
var isDone = false;  //页面是否已经渲染
var self;
var isClick = 0;
export default {
  props: ["datas", "index"],
  data() {
    return {
      isLoadMore: true, //true 可以加载更多
      page: 1,
      total_page: 0,
      showMore: true
    };
  },
  mounted() {
    this.total_page = Math.ceil(this.datas.total / 12);
    if(this.total_page > 1) {
      this.$store.state.temp.item.data[this.index].isLoadMore = true;
    }
    // 判断商品组件mounted的时候是否需要加载更多
    this.isLoadMore = this.$store.state.temp.item.data[this.index].isLoadMore;
    self = this;
    if (!isDone && this.datas.Identification === 1) {
      document.addEventListener("touchmove", this.handleScroll, false);
      isDone = true;
    }
  },
  activated() {
    this.total_page = Math.ceil(this.datas.total / 12);
    if(this.total_page > 1 && (this.page < this.total_page)) {
      this.$store.state.temp.item.data[this.index].isLoadMore = true;
    }
    this.isLoadMore = this.$store.state.temp.item.data[this.index].isLoadMore;
    if (!isDone && this.datas.Identification === 1) {
      document.addEventListener("touchmove", this.handleScroll, false);
      isDone = true;
    }
  },
  deactivated() {
    if (isDone && this.datas.Identification === 1) {
      document.removeEventListener("touchmove", this.handleScroll, false);
      isDone = false;
    }
  },
  watch: {
    total_page() {
      let data = { index: this.index };
      this.page >= this.total_page
        ? (data.isLoadMore = false)
        : (data.isLoadMore = true);
      this.$store.commit("setLoadMore", data);
    },
    page() {
      let data = { index: this.index };
      this.page >= this.total_page
        ? (data.isLoadMore = false)
        : (data.isLoadMore = true);
      this.$store.commit("setLoadMore", data);
    }
  },
  computed: {
    showTitle() {
      if (this.datas.params.showname == "0") {
        return false;
      } else if (this.datas.params.showname == "1") {
        return true;
      } else {
        return false;
      }
    }
  },
  methods: {
    buy(obj) {
      this.$router.push(this.fun.getUrl("goods", {
        id: obj.goodid
      }));
    },
    showTime(time) {
      let nowTime = new Date().getSeconds;
      let beginTime = new Date(time).getSeconds;
      if (nowTime >= beginTime) {
        return true;
      } else {
        return false;
      }
    },
    //获取滚动条当前的位置
    getScrollTop() {
      var scrollTop = 0;
      if (documentElement && documentElement.scrollTop) {
        scrollTop = documentElement.scrollTop;
      } else if (body) {
        scrollTop = body.scrollTop;
      }
      return scrollTop;
    },
    //获取当前可视范围的高度
    getClientHeight() {
      var clientHeight = 0;
      if (body.clientHeight && documentElement.clientHeight) {
        clientHeight = Math.min(
          body.clientHeight,
          documentElement.clientHeight
        );
      } else {
        clientHeight = Math.max(
          body.clientHeight,
          documentElement.clientHeight
        );
      }
      return clientHeight;
    },
    //获取文档完整的高度
    getScrollHeight() {
      return Math.max(body.scrollHeight, documentElement.scrollHeight);
    },
    handleScroll() {
      //滚动事件触发
      if (Number(this.getScrollTop() + this.getClientHeight() + 105) >= this.getScrollHeight()) {
        //此处发起请求
        if (typeof self.$store.state.temp.item.data[self.index].isLoadMore === "undefined") {
          self.$store.state.temp.item.data[self.index].isLoadMore = true;
        }
        if (self.$store.state.temp.item.data[self.index].isLoadMore && isClick === 0) {
          self.getMoreData();
          isClick = 1;
        } else {
          self.isLoadMore = self.$store.state.temp.item.data[self.index].isLoadMore;
          console.log("没有数据了");
        }
      }
    },
    // 获取更多数据
    getMoreData() {
      const that = this;
      let data = { index: this.index, isLoadMore: false };
      that.isLoadMore = false;
      this.$store.commit("setLoadMore", data); // 防止多次请求分页数据
      if (that.page >= that.total_page) {
        return;
      } else {
        that.page = that.page + 1;
        $http
          .get(
            "home-page.get-page-goods",
            {
              page: that.page,
              group_id: that.datas.id
            },
            "加载中"
          )
          .then((response) => {
            // that.isLoadMore = true;
            if (response.result === 1) {
              var myData = { data: response.data.data, index: that.index };
              that.$store.commit("setMoreData", myData);
              // that.datas.data = that.datas.data.concat(myData);//数组拼接
            } else {
              that.page = that.page - 1;
              let data = { index: that.index, isLoadMore: false };
              that.$store.commit("setLoadMore", data);
            }
          }, (response) => {
            console.error(response);
            // error callback
          }
          );
      }
    }
  }
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
  #time-limit {
    .loadMore {
      background: #f5f5f5;
      width: 100%;
      height: 40px;
      line-height: 40px;
      text-align: center;
      clear: both;
    }
  }

  #rush-buy {
    padding: 1px 0;

    /* background: none !important; */
    .buy-5 {
      border: solid #f15353 0.0625rem !important;
      color: #f15353 !important;
      border-radius: 0.625rem;
      background-color: #fff !important;
    }

    .buy-6 {
      border: solid #f15353 0.0625rem !important;
      color: #fff !important;
      border-radius: 0.625rem !important;
      background-color: red !important;
    }

    .buy-7 {
      border: solid #f15353 0.0625rem !important;
      color: #f15353 !important;
      border-radius: 0.3125rem !important;
      background-color: #fff !important;
    }

    .buy-8 {
      border: solid #f15353 0.0625rem !important;
      color: #fff !important;
      border-radius: 0.3125rem !important;
      background-color: red !important;
    }

    .sale-xp {
      background: url(../assets/images/sale-xp.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    .sale-rx {
      background: url(../assets/images/sale-rx.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    .sale-tj {
      background: url(../assets/images/sale-tj.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    .sale-xs {
      background: url(./temp/img/sale-xs.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    .sale-by {
      background: url(./temp/img/sale-by.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    .sale-cx {
      background: url(./temp/img/sale-cx.png);
      background-size: 3.125rem;
      height: 3.125rem;
      width: 3.125rem;
      position: absolute;
      top: -0.1875rem;
      left: -0.1875rem;
    }

    h2 {
      font-weight: normal;
    }

    .double-row {
      display: flex;
      flex-wrap: wrap;
      margin: 0.5rem 0.75rem;

      .list-box {
        margin-right: 2%;
        margin-bottom: 0.5rem;
        background-color: #fff;
        width: 49%;
        border-radius: 0.5rem;

        .img {
          height: 0;
          padding-bottom: 100%;
          overflow: hidden;
          background-color: #ccc;
          position: relative;
          background-size: 100% 100%;
          border-top-left-radius: 0.5rem;
          border-top-right-radius: 0.5rem;

          img {
            width: 100%;
            height: 100%;
          }

          .time-box {
            width: 100%;
            position: absolute;
            min-height: 1.875rem;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.4), rgba(153, 153, 153, 0.1));
            bottom: 0;
            text-align: left;
            padding: 0 0.625rem;

            span {
              color: #fff;
              line-height: 1.875rem;
              font-size: 14px;
              text-align: left;
            }
          }
        }

        .text {
          padding: 0.375rem 0.5rem;

          h2 {
            line-height: 1.25rem;
            height: 2.5rem;
            font-size: 14px;
            text-align: left;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
          }

          .price {
            line-height: 1.5rem;
            display: flex;
            justify-content: space-between;
            font-size: 16px;

            .left {
              color: #f15353;
              font-weight: bold;
              font-size: 18px;
            }

            .right {
              font-size: 14px;
              text-decoration: line-through;
              color: #8c8c8c;
            }

            small {
              font-size: 12px;
            }
          }

          .rob {
            line-height: 1.5rem;
            display: flex;
            justify-content: space-between;
            font-size: 12px;
            color: #8c8c8c;

            .left {
              big {
                color: #f15353;
                font-size: 14px;
              }
            }

            button {
              background-color: #f15353;
              color: #fff;
              font-size: 12px; //border-radius: 0.1875rem;
              height: 1.625rem;
              border-radius: 0.25rem;
              padding: 0 0.375rem;
              display: inline-block;
              border: none;
            }
          }
        }
      }

      .list-box:last-child {
        margin-bottom: 0;
      }

      .list-box:nth-last-child(2) {
        margin-bottom: 0;
      }

      .list-box:nth-child(2n) {
        margin-right: 0;
      }
    }

    .single-row {
      background-color: #fff;
      //margin-top: 0.5rem;
      margin: 0.5rem 0.75rem;
      border-radius: 0.5rem;

      .img {
        position: relative;
        background-color: #ccc;
        width: 100%;
        height: 0;
        padding-bottom: 100%;
        overflow: hidden;
        background-size: 100% 100%;
        border-top-left-radius: 0.5rem;
        border-top-right-radius: 0.5rem;

        img {
          width: 100%;
          height: 100%;
        }

        .time-box {
          width: 100%;
          position: absolute;
          height: 2.5rem;
          background: linear-gradient(to top, rgba(0, 0, 0, 0.4), rgba(153, 153, 153, 0.1));
          bottom: 0;
          text-align: left;
          padding: 0 0.625rem;

          span {
            color: #fff;
            line-height: 2.5rem;
            font-size: 1rem;
            text-align: left;
          }
        }
      }

      .text {
        padding: 0.375rem 0.625rem;

        .title {
          display: flex;
          justify-content: space-between;
          font-size: 14px;

          h2 {
            flex: 2;
            font-size: 16px;
            line-height: 1.5rem;
            height: 3rem;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
            text-align: left;
          }

          span {
            text-align: right;
            flex: 1;
            font-size: 16px;

            big {
              font-size: 20px;
              color: #f15353;
            }
          }
        }

        .price {
          display: flex;
          justify-content: space-between;
          font-size: 14px;
          margin-top: 0.625rem;

          .left {
            font-size: 18px;
            color: #f15353;
            line-height: 1.625rem;

            small {
              font-size: 12px;
            }

            .price-b {
              margin-left: 0.625rem;
              color: #999;
              text-decoration: line-through;
              font-size: 14px;
            }
          }

          button {
            border: none;
            //background-color: #f15353;
            color: #f15353;
            height: 1.875rem;
            font-size: 14px;
            border-radius: 0.1875rem;
            padding: 0 0.625rem;
          }
        }
      }
    }

    .three-row {
      margin: 0.5rem 0.75rem;
      display: flex;
      flex-wrap: wrap;

      dl:nth-child(3n) {
        margin-right: 0;
      }

      dl {
        width: 32%;
        background-color: #fff;
        margin-right: 2%;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;

        .img {
          border-top-left-radius: 0.5rem;
          border-top-right-radius: 0.5rem;
          position: relative;
          height: 0;
          padding-bottom: 100%;
          background-size: 100% 100%;
          background-color: #ccc;

          img {
            width: 100%;
            height: 100%;
          }

          .time-box {
            width: 100%;
            position: absolute;
            min-height: 1.875rem;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.4), rgba(153, 153, 153, 0.1));
            bottom: 0;
            text-align: left;
            padding: 0 0.25rem;

            span {
              color: #fff;
              line-height: 1.875rem;
              font-size: 12px;
              text-align: left;
            }
          }
        }

        .text {
          padding: 0.375rem;

          h2 {
            text-align: left;
            font-size: 12px;
            line-height: 1.125rem;
            height: 2.25rem;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
          }

          .price {
            line-height: 1.5rem;
            display: flex;
            justify-content: space-between;
            font-size: 14px;

            .price-a {
              color: #f15353;
            }

            .price-b {
              color: #999;
              text-decoration: line-through;
            }

            small {
              font-size: 12px;
            }
          }

          .rob {
            text-align: left;
            line-height: 1.5rem;

            .left {
              big {
                color: #f15353;
              }
            }
          }

          .button {
            button {
              width: 100%;
              height: 1.625rem;
              border: none;
              background-color: #f15353;
              color: #fff;
              font-size: 12px;
              border-radius: 0.25rem;
              padding: 0 0.25rem;
            }
          }
        }
      }
    }

    .across-row {
      //margin-top: 0.625rem;
      .list {
        background-color: #fff;
        display: flex;

        .img {
          width: 8.75rem;
          height: 8.75rem;
          position: relative;

          img {
            width: 100%;
            height: 100%;
            padding: 0.375rem;
          }

          .time-box {
            width: 92%;
            position: absolute;
            min-height: 1.875rem;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.4), rgba(153, 153, 153, 0.1));
            bottom: 0.375rem;
            left: 0.375rem;
            text-align: center;

            span {
              color: #fff;
              line-height: 1.875rem;
              font-size: 14px;
              text-align: left;
            }
          }
        }

        .text {
          width: auto;
          flex: 1;
          position: relative;
          padding: 0.625rem;
          border-bottom: solid 0.0625rem #ebebeb;

          h2 {
            line-height: 1.5rem;
            height: 3rem;
            text-align: left;
            font-size: 16px;
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
          }

          .price {
            line-height: 1.875rem;
            display: flex;
            justify-content: space-between;
            font-size: 16px;

            small {
              font-size: 12px;
            }

            .price-a {
              color: #f15353;
            }

            .price-b {
              color: #999;
              text-decoration: line-through;
            }
          }

          .rob {
            position: absolute;
            bottom: 0.625rem;
            font-size: 14px;
            line-height: 1.5rem;
            text-align: left;

            big {
              color: #f15353;
            }
          }

          .button {
            position: absolute;
            bottom: 0.625rem;
            right: 0.625rem;
            text-align: left;

            button {
              border: none;
              background-color: #f15353;
              color: #fff;
              border-radius: 0.25rem;
              padding: 0.375rem 0.75rem;
            }
          }
        }
      }
    }
  }
</style>
